<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="en"><head>
    <meta charset="utf-8">
    <title>商品管理</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="<%=basePath%>lib/font-awesome/css/font-awesome.css">

    <script src="lib/jquery-1.11.1.min.js" type="text/javascript"></script>

    

    <link rel="stylesheet" type="text/css" href="<%=basePath%>stylesheets/theme.css">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>stylesheets/premium.css">


    <style>
      
    .info{
      padding: 20px 50px 0 50px;
    }
    footer{
      position:absolute;
      bottom:0px;
      left:0px;
      width:100%;
    }
    footer > p{
      margin: 0 50px 0 50px;
    }
    .pageinfo{
    	margin-left:850px;
    	
    }
    .table{
    	margin-top:40px;
    }
	
    </style>

</head>
<body class=" theme-blue">

   
	
	
	

    <script type="text/javascript">
        $(function() {
            var match = document.cookie.match(new RegExp('color=([^;]+)'));
            if(match) var color = match[1];
            if(color) {
                $('body').removeClass(function (index, css) {
                    return (css.match (/\btheme-\S+/g) || []).join(' ')
                })
                $('body').addClass('theme-' + color);
            }

            $('[data-popover="true"]').popover({html: true});
            
        });
    </script>
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;

        }
        .navbar-default .navbar-brand, .navbar-default .navbar-brand:hover { 
            color: #fff;
        }
    </style>

    <script type="text/javascript">
        $(function() {
            var uls = $('.sidebar-nav > ul > *').clone();
            uls.addClass('visible-xs');
            $('#main-menu').append(uls.clone());
        });
    </script>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  

  <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
  <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
  <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
  <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
  <!--[if (gt IE 9)|!(IE)]><!--> 
   
  <!--<![endif]-->

    <div class="navbar navbar-default" role="navigation">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="" href="index.html"><span class="navbar-brand"><span class="fa fa-paper-plane"></span><span style="margin-left:10px;letter-spacing:2px;"> 管理员</span></a></div>

        <div class="navbar-collapse collapse" style="height: 1px;">
          <ul id="main-menu" class="nav navbar-nav navbar-right">
            <li class="dropdown hidden-xs">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="glyphicon glyphicon-user padding-right-small" style="position:relative;top: 3px;"></span> Jack Smith
                    <i class="fa fa-caret-down"></i>
                </a>

              <ul class="dropdown-menu">
                <li><a tabindex="-1" href="sign-in.html">Logout</a></li>
              </ul>
            </li>
          </ul>

        </div>
      </div>
    </div>
    

    

    <div class="">
        <div class="header info" style="height:80px;">
            
            <h1 class="page-title" style="line-height:40px; color:#099;font-size:20px;">商品管理</h1>
        </ul>

        </div>
        <div class="main-content info">
            
              <div class="btn-toolbar list-toolbar">
                  <a href="/adminadd"><button class="btn btn-info"><i class="fa fa-plus"></i> <span style="letter-spacing: 2px;font-size:13px;color:#fff;padding-left:10px;">商品</span></button></a>
                 <form action="/a/${admin.aid}/home" method="post">
                                 
                  <input type="text" name="gname" class="form-control" style="width:350px; position:absolute; left:180px; top:178px;" placeholder="请输入商品名称">
                  <input type="submit" class="btn btn-info" style="position:absolute; height:30px;line-height:19px;letter-spacing:2px;left:470px; top:180px;z-index:3;" value="搜索">
                  
                 </form>
                <div class="btn-group">
                </div>
              </div>
              <table class="table">
                <thead>
                  <tr>
                    <th>商品id</th>
                    <th>商品名称</th>
                    <th>商品库存</th>
                    <th>商品价格</th>
                    <th style="width: 3.5em;">操作</th>
                  </tr>
                </thead>
                <tbody>
                 <c:forEach items="${pi.list }" var="item">
                 
                  <tr>
                    <td>${item.gid}</td>
                    <td>${item.gname}</td>
                    <td>${item.gnum}</td>
                    <td>${item.gprice}</td>
                    <td>
                        <a href="/a/${item.gid}/edit"><i class="fa fa-pencil"></i></a>
                        <a href="/a/${item.gid}/delt" role="button" data-toggle="modal"><i class="fa fa-trash-o" style="margin-left:5px;"></i></a>
                    </td>
                  </tr>
                 
                 
                 </c:forEach>
                  
                </tbody>
              </table>


			<nav class="pageinfo" >
			  <ul class="pagination">
			  	<li><a href="#">共${pi.count }条/${pi.total }页</a></li>
			    <c:if test="${pi.current gt 1 }">
					<li><a href="?current=1">首&nbsp;页</a></li>
					<li><a href="?current=${pi.current - 1 }">上一页</a></li>
				</c:if>
				<c:if test="${pi.current == 1 }">
					<li><a href="?current=1">首&nbsp;页</a></li>
					<li><a href="?current=1">上一页</a></li>
				</c:if>
			    <li><a href="#">第${pi.current }页</a></li>
			    <c:if test="${pi.current lt pi.total }">
					<li><a href="?current=${pi.current + 1 }">下一页</a></li>
					<li><a href="?current=${pi.total }">尾&nbsp;页</a></li>
				</c:if>
				<c:if test="${pi.current == pi.total }">
					<li><a href="?current=${pi.total }">下一页</a></li>
					<li><a href="?current=${pi.total }">尾&nbsp;页</a></li>
				</c:if>
			  </ul>
			</nav>
			
          

            <footer>
                <hr>

                <!-- Purchase a site license to remove this link from the footer: http://www.portnine.com/bootstrap-themes -->
                <p class="pull-right">A <a href="http://www.portnine.com/bootstrap-themes" target="_blank">Free Bootstrap Theme</a> by <a href="http://www.portnine.com" target="_blank">Portnine</a></p>
                <p>© 2014 <a href="http://www.portnine.com" target="_blank">Portnine</a></p>
            </footer>
        </div>
    </div>


    <script src="<%=basePath%>lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });
    </script>
    
  
</body></html>
